<template>
  <div>
    <span class="print_back" @click="back">返回</span>
    <div class="box">
    <Printdetail :list="list" />
    <div class="operation">
      <p class="set">
        <span>预览</span>
        <span>打印</span>
      </p>
      <p>打印规格：<input type="text" /></p>
      <p class="tips">打印规格需要在店铺管理员在商家后台->店铺->打印设置中进行设置。</p>
      <p class="title">点击按钮进行设置</p>
      <span class="goset">去设置</span>
    </div>
  </div>
  </div>
</template>

<script>
import Printdetail from "@/components/Order/order_printdetail";
import { createNamespacedHelpers } from "vuex";
const { mapState } = createNamespacedHelpers("order");
export default {
  data() {
    return {
      sepcs: "",
      list: [],
    };
  },
  components: {
    Printdetail,
  },
  methods: {
    back(){
      window.history.back()
    }
  },
  mounted() {
    let id_num = this.$route.params.id;
    this.list = this.orderList.filter((item) => item.ord_num === id_num)[0];
  },
  computed: {
    ...mapState({
      orderList: (state) => state.orderList,
    }),
  },
};
</script>

<style scoped>
.box {
  width: 96%;
  margin: 10px auto;
  box-sizing: border-box;
  padding: 10px 20px;
  background: #eee;
  border: 1px solid lightgray;
  display: flex;
}
.operation {
  width: 15%;
  margin-left: 20px;
  font-size: 12px;
}
.set {
  margin-bottom: 10px;
}
.set span {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid lightgray;
  color: #333;
  background: white;
  margin-right: 30px;
  cursor: pointer;
}
input {
  width: 60px;
}
.tips {
  margin: 20px 0;
}
.title {
  color: red;
}
.goset {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid lightgray;
  margin-top: 12px;
  background: white;
  color: #666;
  cursor: pointer;
}
.print_back{
  display: inline-block;
  cursor: pointer;
  margin: 12px 0 0 2.5%;
  width: 60px;
  text-align: center;
  line-height: 30px;
  background: #eee;
  color: #333;
  border-radius: 15px;
  font-size: 12px;
}
.back:hover{
  background: skyblue;
  color: white;
}
</style>
